package defaultproperty.classes;


import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Hashtable;
import utility.MyDate;
import dbmanager.DBManager;


public class Sysdate implements Class
{
	String value;
	DBManager database;
	Hashtable<Object ,Object> table = new Hashtable<Object, Object>();
	String format="format";
	String DAY ="day";
	public String getResult() 
	{
		if(table.containsKey(format))
			format = table.get(format).toString();
		else
			format = "yyyy-MM-dd HH:MM:ss";
		SimpleDateFormat sdm = new SimpleDateFormat(format);
		if(table.contains(DAY))
		{
			int numberofday = Integer.parseInt(table.get(DAY).toString());
			MyDate mydate = new MyDate();
			return mydate.getNextDate(sdm.format(new Date()), numberofday).toString();
		}
		else
			return sdm.format(new Date());
	}
	public void setObject(DBManager database) 
	{	
		this.database = database;
	}

	public void setPropertymap(Hashtable<Object, Object> propetrymap,String Object) 
	{
		this.table.putAll(propetrymap);
	}
}
